package com.h3c.nem.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.h3c.nem.dto.TbApprovalRecordDTO;
import com.h3c.nem.dto.form.ConfigTheFormSubmit;
import com.h3c.nem.entity.TbApprovalRecord;
import com.h3c.nem.vo.TbApprovalRecordVO;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Copyright (C), 2020-2020, h3c
 * FileName: ITbApprovalRecordService
 *
 * @Author: l22886
 * @Date: 2022-01-19
 * Description: tb_approval_record service
 * Version: 1.0
 */
public interface ITbApprovalRecordService extends IService<TbApprovalRecord> {


    /**
     * 保存审批记录
     *
     * @param flowId           工单编号（没有工单编号为员工工号）
     * @param approvalType     审批类型（枚举）
     * @param approvalUserId   审批人工号
     * @param approvalUserInfo 审批人工号/姓名
     * @param approvalNote     审批单备注
     */
    void saveRecord(String flowId, Integer approvalType, String approvalUserId, String approvalUserInfo, String approvalNote);

    /**
     * @param approvalResult 审批结果
     */
    void saveRecord(String flowId, Integer approvalType, String approvalUserId, String approvalUserInfo,
                    String approvalNote, Integer approvalResult);

    void saveRecord(String flowId, Integer approvalType, String approvalUserId, String approvalUserInfo,
                    String approvalNote, Integer approvalResult, String source, Date beginDate, Date endDate);

    public Map<String, Object> queryApprovalRecord(TbApprovalRecordDTO dto);

    public Integer approve(TbApprovalRecordDTO dto);

    public void wxApprove(ConfigTheFormSubmit formSubmit);

    public TbApprovalRecord queryApprovalDraft(TbApprovalRecordDTO dto);

    /**
     * offer信息修改记录
     * @param recordId offer发送记录ID
     * @return
     */
    List<TbApprovalRecordDTO> getApprovalRecordList(String recordId);

    /**
     * 查询新员工审批记录
     * @return
     */
    List<TbApprovalRecordVO> queryNewStaffRecord();

    /**
     * 查询新员工产生的未读审批角标
     * @return
     */
    Integer countNewStaffNoRead();

    Integer selectRecordByDate(String id, int type, Date beginDate, Date endDate);
}
